/*
 * @Author: 袁十一
 * @Date: 2023-09-25 15:29:30
 * @LastEditTime: 2023-10-13 17:00:54
 * @LastEditors: Please set LastEditors
 * @Description: 统一管理咱们项目用户相关的接口，在此发送请求
 * @FilePath: \Vue3_admin_template\src\api\user\index.ts
 * 初心不变，意志坚定
 */
import request from '@/util/request'
import { loginFormData, userInfoResponseData } from './type'
enum API {
  LOGIN_URL = '/admin/acl/index/login',
  USERINFO_URL = '/admin/acl/index/info',
  LOGOUT_URL = '/admin/acl/index/logout',
}
// 用户登录请求,<any,loginFormData>泛型第二个是约束函数返回值类型
export const reqLogin = (data: loginFormData) =>
  request.post<any, loginFormData>(API.LOGIN_URL, data)
// 获取用户信息请求
export const reqUserInfo = () =>
  request.get<any, userInfoResponseData>(API.USERINFO_URL)
// 用户退出登录请求
export const reqLogout = () => request.post<any, any>(API.LOGOUT_URL)
